import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-1,2,10)
y = x-1
plt.figure(1)
plt.plot(x,y,linewidth=1,linestyle='--',)
plt.xlim(-1,2)
plt.ylim(-2,1)
plt.xlabel('x')
plt.ylabel('y')
y_ticks = np.linspace(-2,1,7)
plt.xticks([-1,-.5,1],['bad','normal','good'])
plt.yticks(y_ticks)

ax = plt.gca()
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
ax.spines['bottom'].set_position(('data',0))
ax.spines['left'].set_position(('data',0))
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
plt.show()